#!/bin/sh
rm -rf ./release
mkdir -p release/crontab-master
mkdir -p release/crontab-worker
cp -r ./master/main/webroot ./release/crontab-master

master_dir="/Users/apple/studyspace/Golang-LearningSpace/Crontab/crontab/master/main"
worker_dir="/Users/apple/studyspace/Golang-LearningSpace/Crontab/crontab/worker/main"

release_master="/Users/apple/studyspace/Golang-LearningSpace/Crontab/crontab/release/crontab-master"
release_worker="/Users/apple/studyspace/Golang-LearningSpace/Crontab/crontab/release/crontab-worker"


cd $master_dir
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build master.go
cp ${master_dir}/master $release_master
cp ${master_dir}/master.json $release_master
rm master

cd $worker_dir
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build worker.go
cp ${worker_dir}/worker $release_worker
cp ${worker_dir}/worker.json $release_worker
rm worker

#linux下运行
# nohup ./chat >> ./log.log 2>&1 &
